package com.kehutong.payfees.admin;

//import java.io.IOException;
//import java.util.Arrays;
//import java.util.List;
//
//import com.kehutong.common.util.Token;
//import com.kehutong.payfees.service.ChargeLawyerMediationServiceImpl;
//import org.coraframework.authz.HasPermission;
//import org.coraframework.inject.Inject;
//import org.coraframework.json.JSONObject;
//import org.coraframework.mvc.MvcAction;
//import org.coraframework.mvc.http.Bean;
//import org.coraframework.mvc.http.ReqMapping;
//import org.coraframework.mvc.http.result.Result;
//import org.coraframework.orm.jdbc.SQLSession;
//import org.coraframework.util.Objects;
//
//import com.kehutong.payfees.entity.ChargeBill;
//import com.kehutong.payfees.enums.MediationType;
//
//@MvcAction
//@ReqMapping("/admin/charge/lawyer/mediation")
//public class ChargeLawyerMediationAction {
//
//    @Inject
//    private SQLSession sqlSession;
//
//    @Inject
//    private ChargeLawyerMediationServiceImpl chargeLawyerMediationActionService;
//
//    @HasPermission("charge:mediation:view")
//    @ReqMapping("/page")
//    public Object getChargePage(JSONObject jsonObject) {
//        if (Objects.isEmpty(jsonObject.getString("communityNo"))) {
//            return Result.error(-1, "请选择小区");
//        }
//        return Result.success(chargeLawyerMediationActionService.getChargeLawyerList(jsonObject));
//    }
//
//    @HasPermission("charge:mediation:view")
//    @ReqMapping("/lawyer/page")
//    public Object getLawyerChargePage(Token token, JSONObject jsonObject) throws Exception {
//        return Result.success(chargeLawyerMediationActionService.getLawyerChargePage(token, jsonObject));
//    }
//
//    @Bean(newInstance=true, copy=true)
//    @HasPermission("charge:mediation:edit")
//    @ReqMapping("/save")
//    public Object saveLawyerCharge(Token token, JSONObject jsonObject) throws Exception {
//        chargeLawyerMediationActionService.saveLawyerCharge(token, jsonObject);
//        return Result.success();
//    }
//
//    @HasPermission("charge:mediation:view")
//    @ReqMapping("/get")
//    public Object getLawyerChargeDetail(String id) {
//        List<ChargeBill> lawyerChargeDetail = chargeLawyerMediationActionService.getLawyerChargeDetail(id);
//        if (Objects.isNull(lawyerChargeDetail)) {
//            Result.error(0, "对象不存在");
//        }
//        return Result.success(lawyerChargeDetail);
//    }
//
//    @Bean(newInstance=false, copy=true)
//    @HasPermission("charge:mediation:edit")
//    @ReqMapping("/update")
//    public Object updateLawyerCharge(JSONObject jsonObject) {
//        chargeLawyerMediationActionService.updateLawyerCharge(jsonObject);
//        return Result.success();
//    }
//
//    @HasPermission("charge:mediation:view")
//    @ReqMapping("/get/detail/byId")
//    public Object getLawyerChargeDetailById(JSONObject jsonObject) {
//        return Result.success(chargeLawyerMediationActionService.getLawyerChargeDetailById(jsonObject));
//    }
//
//    @HasPermission("charge:mediation:view")
//    @ReqMapping("/export/detail/byId")
//    public Object exportById(JSONObject jsonObject) throws IOException {
//        return Result.download(chargeLawyerMediationActionService.exportById(jsonObject));
//    }
//
//    @HasPermission("charge:mediation:view")
//    @ReqMapping("/get/byId")
//    public Object getLawyerChargeById(Token token, String id) throws Exception {
//        return Result.success(chargeLawyerMediationActionService.getLawyerChargeById(token, id));
//    }
//
//    @HasPermission("charge:mediation:view")
//    @ReqMapping("/enums")
//    public Object getEnums() {
//        return Result.success(Arrays.asList(MediationType.values()));
//    }
//
//    @HasPermission("charge:mediation:edit")
//    @ReqMapping("/change/status")
//    public Object changeMediationStatusById(JSONObject jsonObject) {
//        return chargeLawyerMediationActionService.changeMediationStatusById(jsonObject);
//    }
//
//    @HasPermission("charge:mediation:edit")
//    @ReqMapping("/update/handler")
//    public Object updateLawyerChargeHandler(JSONObject jsonObject) {
//        chargeLawyerMediationActionService.updateLawyerChargeHandler(jsonObject);
//        return Result.success();
//    }
//
//    @HasPermission("charge:mediation:edit")
//    @ReqMapping("/update/more/handler")
//    public Object updateLawyerChargeHandlerMore(Token token, JSONObject jsonObject) throws Exception {
//        chargeLawyerMediationActionService.updateLawyerChargeHandlerMore(token, jsonObject);
//        return Result.success();
//    }
//}
